﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ref_PostgresEFCore
{
    public static class PostgresHelper
    {
        public static string GetPostgresTypeFromType(string name)
        {
            switch (name)
            {
                case "System.String": return "varchar";
                case "System.Double": return "numeric";
                case "System.Int32": return "integer";
                case "System.Int64": return "bigint";
                case "System.Boolean": return "bool";
                default:
                    return name.Split('.').Last().ToLower();
            }
        }
    }
}
